local qunxian3__baishoukaiduo_rexi = fk.CreateSkill {

  name = "qunxian3__baishoukaiduo_rexi",

  tags = {},

}

Fk:loadTranslationTable {
  ["qunxian3__baishoukaiduo_rexi"] = "热息",
  [":qunxian3__baishoukaiduo_rexi"] = [[你可将你的伤害牌转化为不计入次数的【火杀】使用，当你使用【火杀】指定角色为目标后，你获得其一张牌。]],
  ['#qunxian3__baishoukaiduo_rexi'] = '热息：你可将你的伤害牌转化为不计入次数的【火杀】使用',
  ['#qunxian3__baishoukaiduo_rexi-choose_card'] = '热息：你可以获得其一张牌',
  ["$qunxian3__baishoukaiduo_rexi"] = "热息",
}

qunxian3__baishoukaiduo_rexi:addEffect("viewas", {
  anim_type = "offensive",
  pattern = "fire__slash",
  prompt = "#qunxian3__baishoukaiduo_rexi",
  handly_pile = true,
  card_filter = function(self, player, to_select, selected, selected_targets)
    return Fk:getCardById(to_select).is_damage_card and #selected == 0
  end,
  card_num = 1,
  enabled_at_response = function(self, player, response)
    return not response
  end,
  view_as = function(self, player, cards)
    if #cards ~= 1 then return end
    local c = Fk:cloneCard("fire__slash")
    c.skillName = qunxian3__baishoukaiduo_rexi.name
    c:addSubcard(cards[1])
    return c
  end,
})

qunxian3__baishoukaiduo_rexi:addEffect("targetmod", {
  bypass_times = function(self, player, skill, scope, card)
    return card and card.name == "fire__slash" and scope == Player.HistoryPhase and
        table.contains(card.skillNames, qunxian3__baishoukaiduo_rexi.name) and
        player:hasSkill("qunxian3__baishoukaiduo_rexi")
  end,
})

qunxian3__baishoukaiduo_rexi:addEffect(fk.TargetSpecified, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(qunxian3__baishoukaiduo_rexi.name) and data.card and
        data.card.name == "fire__slash" and not data.to:isNude()
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local cards = room:askToChooseCard(player, {
      target = data.to,
      skill_name = qunxian3__baishoukaiduo_rexi.name,
      flag = "he",
      prompt = "#qunxian3__baishoukaiduo_rexi-choose_card"
    })
    room:obtainCard(player, cards, false, fk.ReasonPrey, player, qunxian3__baishoukaiduo_rexi.name)
  end
})

return qunxian3__baishoukaiduo_rexi
